package com.qf.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @ClassName My
 * @Author xiao宋
 * @Date 16:51  2022/9/27
 * @Version 1.0
 * @Description TODO
 */
public class MyMethodAround implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        try {
            System.out.println("\t\t环绕通知开始干活了");

            Object o = invocation.proceed();
//            System.out.println(1/0);
            System.out.println("\t\t环绕通知不想干活，去睡觉了");
        } catch (Throwable throwable) {
            throwable.printStackTrace();
            System.out.println("报错了大废物");
        }finally {
            System.out.println("\t\t我早晚是要出来的");
        }

        return null;
    }
}
